
package trim.differentmaterials.core;

import java.util.*;
import trim.common.inputdata.*;
import trim.differentmaterials.coefficients.*;
import trim.differentmaterials.generator.columns.*;

/**
 *
 * @author Podorov Alexander
 */

public abstract class TrimCoreInitializer
{
    protected final int materialCount;
    protected final int formatCount;

    protected final int[] rightPart;

    protected final MaterialStock[] materialStock;
    protected final FormatOrder[] formatOrder;

    protected final double[][] inverseMatrix;
    protected final List<Column> patterns;

    protected final Coefficients coefficients;
    
    public TrimCoreInitializer(TrimCore model, Coefficients coefficients)
    {
        materialCount = model.getMaterialCount();
        formatCount = model.getFormatCount();

        rightPart = model.getRightPart();

        materialStock = model.getMaterialStock();
        formatOrder = model.getFormatOrder();

        inverseMatrix = model.getInverseMatrix();
        patterns = model.getPatterns();

        this.coefficients = coefficients;
    }

    public void initialize()
    {        
        setInverseMatrix();
        setRightPart();
        setPatterns();
    }

    protected abstract void setInverseMatrix();

    protected abstract void setRightPart();

    protected abstract void setPatterns();
}
